//  this library.
enum PaymentTypeEnum {
  weixin(desc: "微信支付", code: 1),
  alipay(desc: "支付宝支付", code: 2),
  balance(desc: "余额支付", code: 3),
  offline(desc: "线下交易", code: 5),
  free(desc: "免费支付", code: 6),
  agentpay(desc: "代理商支付", code: 7),
  activationCode(desc: "激活码支付", code: 8),
  applypay(desc: "苹果支付", code: 9),
  ;

  final String desc;

  final int code;

  const PaymentTypeEnum({
    required this.desc,
    required this.code,
  });

  static PaymentTypeEnum? getTypeEnum(String type) {
    var values = PaymentTypeEnum.values;
    for (var value in values) {
      if (value.name == type) {
        return value;
      }
    }
    return null;
  }
}

enum PaymentStatusEnum {
  waitPay,
  paySuccess,
  ;

  const PaymentStatusEnum();

  static PaymentStatusEnum? getTypeEnum(String type) {
    var values = PaymentStatusEnum.values;
    for (var value in values) {
      if (value.name == type) {
        return value;
      }
    }
    return null;
  }
}

enum DeviceTypeEnum {
  unknown,
  android,
  ios,
  pc,
  h5,
  wxcx,
  admin,
  ;

  const DeviceTypeEnum();

  static DeviceTypeEnum? getTypeEnum(String type) {
    var values = DeviceTypeEnum.values;
    for (var value in values) {
      if (value.name == type) {
        return value;
      }
    }
    return null;
  }
}
